home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gscrdp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  4.0 KB  |  111 lines

  1. /* Copyright (C) 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gscrdp.h,v 1.2 2000/09/19 19:00:27 lpd Exp $ */
  20. /* Interface for device-specified CRDs */
  21.  
  22. #ifndef gscrdp_INCLUDED
  23. #  define gscrdp_INCLUDED
  24.  
  25. #include "gscie.h"
  26. #include "gsparam.h"
  27.  
  28. #ifndef gx_device_DEFINED
  29. #  define gx_device_DEFINED
  30. typedef struct gx_device_s gx_device;
  31. #endif
  32.  
  33. /*
  34.  * A driver can provide any number of its own CRDs through (read-only)
  35.  * device parameters whose values are slightly modified PostScript-style
  36.  * dictionaries.  The driver doesn't need to concern itself with how the
  37.  * parameters are encoded: it simply constructs a CRD and calls
  38.  * param_write_cie_render1.
  39.  *
  40.  * Logically, the pcrd parameter for this procedure and the next one
  41.  * should be declared as const gs_cie_render *, but the procedures may
  42.  * cause certain cached (idempotent) values to be computed.
  43.  */
  44. int param_write_cie_render1(P4(gs_param_list * plist, gs_param_name key,
  45.                    gs_cie_render * pcrd,
  46.                    gs_memory_t * mem));
  47.  
  48. /*
  49.  * For internal use, we also provide an API that writes the CRD directly
  50.  * into a parameter list, rather than as a named parameter in a larger
  51.  * list.
  52.  */
  53. int param_put_cie_render1(P3(gs_param_list * plist, gs_cie_render * pcrd,
  54.                  gs_memory_t * mem));
  55.  
  56. /*
  57.  * Client code that wants to initialize a CRD from a device parameter
  58.  * uses the following complementary procedure.  The customary way to
  59.  * use this is:
  60.  
  61.  gs_c_param_list list;
  62.  ...
  63.  gs_c_param_list_write(&list, mem);
  64.  gs_c_param_request(&list, "ParamName");
  65.  code = gs_getdeviceparams(dev, &list);
  66.  << error if code < 0 >>
  67.  gs_c_param_list_read(&list);
  68.  code = gs_cie_render1_param_initialize(pcrd, &list, "ParamName", dev);
  69.  gs_c_param_list_release(&list);
  70.  << error if code < 0 >>
  71.  
  72.  * where "ParamName" is the parameter name, e.g., "CRDDefault".
  73.  */
  74. int gs_cie_render1_param_initialize(P4(gs_cie_render * pcrd,
  75.                        gs_param_list * plist,
  76.                        gs_param_name key,
  77.                        gx_device * dev));
  78.  
  79. /*
  80.  * Again, we provide an internal procedure that doesn't involve a
  81.  * parameter name.
  82.  */
  83. int param_get_cie_render1(P3(gs_cie_render * pcrd,
  84.                  gs_param_list * plist,
  85.                  gx_device * dev));
  86.  
  87. /*
  88.  * The actual representation of the CRD is a slightly modified PostScript
  89.  * ColorRenderingType 1 dictionary.  THE FOLLOWING IS SUBJECT TO CHANGE
  90.  * WITHOUT NOTICE.  Specifically, the following keys are different:
  91.  *      ColorRenderingType = GX_DEVICE_CRD1_TYPE
  92.  */
  93. #define GX_DEVICE_CRD1_TYPE 101
  94. /*
  95.  *      (Instead of TransformPQR = [T1 T2 T3]:)
  96.  *        TransformPQRName = procedure name (a name)
  97.  *        TransformPQRData = procedure data (a string)
  98.  *      (Instead of EncodeLMN/ABC = [E1 E2 E3]:)
  99.  *        EncodeLMN/ABCValues = [V1,1 V1,2 ... V3,N], where Vi,j is the
  100.  *          j'th sampled value of the i'th encoding array, mapped linearly
  101.  *          to the corresponding domain (see gscie.h)
  102.  *      (Instead of RenderTable = [NA NB NC table m T1 ... Tm]:)
  103.  *        RenderTableSize = [NA NB NC m]
  104.  *        RenderTableTable = table (an array of strings)
  105.  *        RenderTableTValues = [V1,1 V1,2 ... Vm,N] (see above)
  106.  * The PostScript setcolorrendering operator selects the correct operator
  107.  * according to the ColorRenderingType key.
  108.  */
  109.  
  110. #endif /* gscrdp_INCLUDED */
  111.